package core.september.cloudbadge.vcard.example;

import java.io.File;
import java.io.IOException;

import core.september.cloudbadge.vcard.badgemodel.UserVcard;
import ezvcard.example.JohnDoeVCard;
import freemarker.template.TemplateException;

public class Example {

	/**
	 * @param args
	 * @throws TemplateException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException, TemplateException {
		UserVcard user = new UserVcard();
		
		user.getNf().setFamilyName("Geymonat");
		user.getNf().setGivenName("Christian");
		//user.getNf().setPrefix("Mr");
		
		
		user.getWf().setStreetAddress("via Vai Continuo 88");
		user.getWf().setLocality("Torino");
		user.getWf().setRegion("TO");
		user.getWf().setPostalCode("10100");
		user.getWf().setCountry("ITALY");
		
		user.getWf().setOrganization("September Core Ltd.");
		user.getWf().setTitle("CEO and CoFounder");
		
		user.commit();
		
		File file = new File("john-doe.html");
		    JohnDoeVCard.writeHCard(user.getVcard(), file);

	}

}
